<template>
    <div class="content-section" :class="{ active: isActive }">
      <div class="welcome-container">
        <!-- 主要内容区域 -->
        <div class="welcome-content">
          <div class="hero-section">
            <!-- 项目Logo和标题 -->
            <div class="project-brand">
              <div class="brand-icon">
                <div class="icon-container">
                  <span class="main-icon">🚀</span>
                  <div class="icon-glow"></div>
                </div>
              </div>
              <div class="brand-text">
                <h1 class="project-title">WhuOps</h1>
                <p class="project-subtitle">Kubernetes 运维平台</p>
                <div class="project-description">
                  <p>现代化的 Kubernetes 集群管理与监控解决方案</p>
                  <p>智能运维 • 实时监控 • 故障诊断</p>
                </div>
              </div>
            </div>
  
            <!-- 功能特性卡片 -->
            <div class="features-grid">
              <div class="feature-card" @click="navigateToSection('agent')">
                <div class="feature-icon">🤖</div>
                <div class="feature-content">
                  <h3>AI 智能助手</h3>
                  <p>基于人工智能的运维助手，提供智能化的问题解决方案</p>
                </div>
                <div class="feature-arrow">→</div>
              </div>
              
              <div class="feature-card" @click="navigateToSection('monitor')">
                <div class="feature-icon">📊</div>
                <div class="feature-content">
                  <h3>集群监控</h3>
                  <p>实时监控集群状态，Grafana仪表板和Prometheus指标</p>
                </div>
                <div class="feature-arrow">→</div>
              </div>
              
              <div class="feature-card" @click="navigateToSection('fault')">
                <div class="feature-icon">⚠️</div>
                <div class="feature-content">
                  <h3>故障监控</h3>
                  <p>智能故障检测与诊断，快速定位和解决集群问题</p>
                </div>
                <div class="feature-arrow">→</div>
              </div>
            </div>
  
            <!-- 快速开始按钮 -->
            <div class="quick-start">
              <button class="start-btn primary" @click="navigateToSection('monitor')">
                <span class="btn-icon">🚀</span>
                开始使用
              </button>
              <button class="start-btn secondary" @click="scrollToFeatures">
                <span class="btn-icon">📖</span>
                了解更多
              </button>
            </div>
          </div>
  
          <!-- 系统状态概览 -->
          <div class="status-overview" ref="featuresSection">
            <div class="overview-header">
              <h2>系统状态概览</h2>
              <p>实时监控平台运行状态</p>
            </div>
            
            <div class="status-grid">
              <div class="status-item">
                <div class="status-icon">🟢</div>
                <div class="status-content">
                  <h4>平台状态</h4>
                  <p class="status-value">运行正常</p>
                  <span class="status-time">最后检查: 刚刚</span>
                </div>
              </div>
              
              <div class="status-item">
                <div class="status-icon">📈</div>
                <div class="status-content">
                  <h4>监控服务</h4>
                  <p class="status-value">活跃</p>
                  <span class="status-time">3个监控源在线</span>
                </div>
              </div>
              
              <div class="status-item">
                <div class="status-icon">🔧</div>
                <div class="status-content">
                  <h4>AI助手</h4>
                  <p class="status-value">就绪</p>
                  <span class="status-time">智能服务可用</span>
                </div>
              </div>
              
              <div class="status-item">
                <div class="status-icon">⚡</div>
                <div class="status-content">
                  <h4>响应时间</h4>
                  <p class="status-value">100ms</p>
                  <span class="status-time">平均响应时间</span>
                </div>
              </div>
            </div>
          </div>
  
          <!-- 版本信息 -->
          <div class="version-info">
            <div class="version-card">
              <div class="version-content">
                <h3>WhuOps v1.0.0</h3>
                <p>构建时间: {{ buildTime }}</p>
                <p>技术栈: Vue 3 + Kubernetes + Prometheus</p>
              </div>
              <div class="tech-badges">
                <span class="tech-badge">Vue 3</span>
                <span class="tech-badge">Kubernetes</span>
                <span class="tech-badge">Prometheus</span>
                <span class="tech-badge">Grafana</span>
              </div>
            </div>
          </div>
        </div>
  
        <!-- 装饰性元素 -->
        <div class="decoration-elements">
          <div class="floating-element element-1"></div>
          <div class="floating-element element-2"></div>
          <div class="floating-element element-3"></div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  import { ref, computed } from 'vue';
  
  export default {
    name: 'WelcomeSection',
    props: {
      isActive: {
        type: Boolean,
        default: false
      }
    },
    emits: ['navigate'],
    setup(props, { emit }) {
      const featuresSection = ref(null);
  
      const buildTime = computed(() => {
        return new Date().toLocaleDateString('zh-CN');
      });
  
      const navigateToSection = (section) => {
        emit('navigate', section);
      };
  
      const scrollToFeatures = () => {
        if (featuresSection.value) {
          featuresSection.value.scrollIntoView({ 
            behavior: 'smooth',
            block: 'start'
          });
        }
      };
  
      return {
        featuresSection,
        buildTime,
        navigateToSection,
        scrollToFeatures
      };
    }
  };
  </script>
  
  <style scoped>
  .welcome-container {
    height: 100%;
    overflow-y: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
  }
  
  .welcome-content {
    padding: 0;
    position: relative;
    z-index: 2;
  }
  
  .hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    text-align: center;
    position: relative;
  }
  
  .project-brand {
    margin-bottom: 60px;
    animation: fadeInUp 1s ease-out;
  }
  
  .brand-icon {
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
  }
  
  .icon-container {
    position: relative;
    display: inline-block;
  }
  
  .main-icon {
    font-size: 80px;
    display: block;
    position: relative;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
  }
  
  .icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow 2s ease-in-out infinite alternate;
  }
  
  .project-title {
    font-size: 4.5rem;
    font-weight: 800;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -2px;
  }
  
  .project-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 24px 0;
    font-weight: 500;
  }
  
  .project-description {
    max-width: 600px;
    margin: 0 auto;
  }
  
  .project-description p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 8px 0;
    line-height: 1.6;
  }
  
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto 60px auto;
    animation: fadeInUp 1s ease-out 0.3s both;
  }
  
  .feature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }
  
  .feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
  }
  
  .feature-card:hover::before {
    left: 100%;
  }
  
  .feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
  }
  
  .feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
  }
  
  .feature-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
  }
  
  .feature-content p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
  }
  
  .feature-arrow {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 20px;
    color: #667eea;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
  }
  
  .feature-card:hover .feature-arrow {
    opacity: 1;
    transform: translateX(0);
  }
  
  .quick-start {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.6s both;
  }
  
  .start-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    outline: none;
  }
  
  .start-btn.primary {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: #667eea;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
  }
  
  .start-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 255, 255, 0.4);
  }
  
  .start-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
  }
  
  .start-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
  }
  
  .btn-icon {
    font-size: 1.2rem;
  }
  
  .status-overview {
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
  }
  
  .overview-header {
    text-align: center;
    margin-bottom: 60px;
  }
  
  .overview-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px 0;
  }
  
  .overview-header p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
  }
  
  .status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
  }
  
  .status-item {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
  }
  
  .status-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  }
  
  .status-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
  }
  
  .status-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
  }
  
  .status-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
    margin: 0 0 8px 0;
  }
  
  .status-time {
    font-size: 0.9rem;
    color: #999;
  }
  
  .version-info {
    padding: 60px 40px;
    background: rgba(0, 21, 41, 0.95);
    backdrop-filter: blur(20px);
  }
  
  .version-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    color: white;
  }
  
  .version-content h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: white;
  }
  
  .version-content p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 8px 0;
  }
  
  .tech-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
  }
  
  .tech-badge {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.3);
  }
  
  .decoration-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
  }
  
  .floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
  }
  
  .element-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
  }
  
  .element-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
  }
  
  .element-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
  }
  
  /* 动画 */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes float {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-20px);
    }
  }
  
  @keyframes glow {
    from {
      opacity: 0.5;
      transform: translate(-50%, -50%) scale(1);
    }
    to {
      opacity: 0.8;
      transform: translate(-50%, -50%) scale(1.1);
    }
  }
  
  /* 响应式设计 */
  @media (max-width: 768px) {
    .hero-section {
      padding: 40px 20px;
    }
    
    .project-title {
      font-size: 3rem;
    }
    
    .project-subtitle {
      font-size: 1.2rem;
    }
    
    .features-grid {
      grid-template-columns: 1fr;
      gap: 16px;
    }
    
    .quick-start {
      flex-direction: column;
      align-items: center;
    }
    
    .status-overview,
    .version-info {
      padding: 40px 20px;
    }
    
    .overview-header h2 {
      font-size: 2rem;
    }
    
    .status-grid {
      grid-template-columns: 1fr;
      gap: 20px;
    }
  }
  
  @media (max-width: 480px) {
    .project-title {
      font-size: 2.5rem;
    }
    
    .main-icon {
      font-size: 60px;
    }
    
    .feature-card {
      padding: 20px;
    }
    
    .start-btn {
      padding: 12px 24px;
      font-size: 1rem;
    }
  }
  </style>
  